package com.etl.sms.enums;

/**
 * @author Arnold Yand
 * @summary 短信类型
 * @time 2018/07/30
 */
public enum SmsType {

  SIGNUP_VERIFY_CODE(100, "短信验证码（注册）"),
  ;

  private int code;
  private String label;

  private SmsType(int code, String label) {
    this.code = code;
    this.label = label;
  }

  public SmsType parse(int code) {
    for (SmsType v : SmsType.values()) {
      if (v.code == code) {
        return v;
      }
    }

    return null;
  }

  public int getCode() {
    return code;
  }

  public void setCode(int code) {
    this.code = code;
  }

  public String getLabel() {
    return label;
  }

  public void setLabel(String label) {
    this.label = label;
  }
}
